package org.springblade.modules.serial;

import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CustomerInboundHandler extends ChannelInboundHandlerAdapter {
	private static final Logger logger = LoggerFactory.getLogger(CustomerInboundHandler.class);

	@Override
    public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    //channel失效处理,客户端下线或者强制退出等任何情况都触发这个方法
		ChannelConfig config = ctx.channel().config();
		logger.info("{}客户端端开", ctx.channel().remoteAddress());
    super.channelInactive(ctx);
    }
}
